Skip to content

feat: collect addresses from connected peers#421

Draft
xdustinface wants to merge 3 commits intofix/store-all-peersfrom
fix/peer-discovery
Draft

feat: collect addresses from connected peers#421
xdustinface wants to merge 3 commits intofix/store-all-peersfrom
fix/peer-discovery

Conversation

@xdustinface
Copy link
Collaborator

@xdustinface xdustinface commented Feb 6, 2026

We currently don't request any addresses from connected peers so we ever only end up with the 3 addresses we initially try to connect to from the DNS seed lookup. This PR fixes it by making sure we send a GetAddr after handshake and process the responses properly.

See individual commits and their messages.

Based on:

Working towards closing:

This way from the beginning we only add new peers or update existing ones in instead of adding everything with a valid timestamp and then later in the flow drop all duplicates.
Makes sure we send `GetAddr` after handshake to request `Addr`/`AddrV2` messages and convert `Addr` messages to `AddrV2` if we receive them, which shouldn't really happen since we signal v2 support during the handshake.
With the current validation rules we drop most of the addresses while they still might be useful since
it doesn't necessarily mean they are offline. We should still keep more addresses to have at least some addresses
to try to connect to.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/peer-discovery

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant